package test3;

import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;

/**
 * @author oldliu
 * @since 1.0
 */
public class TestConsumer {
    public static void main(String[] args) {
        Consumer<String> f=(s)->{
            System.out.println(s);
            System.out.println(s.toUpperCase());
        };
        f.accept("hello");

        Supplier<Double> s=()->{
            return Math.random();
        };
        System.out.println(s.get());
        Supplier<String> s2=()->{
            return "nihao";
        };
        System.out.println(s2.get());

        Predicate<Double> p=(d)->{
          return d>100;
        };
        System.out.println(p.test(2.4));
        System.out.println(p.test(192.0));

        Function<String,Integer> f22=(s1)->{
            return s1.length();
        };
        System.out.println(f22.apply("nihao"));
    }
}
